package lunchy.main;

import lunchy.data.classes.CLunchyDBConnector;
import lunchy.data.classes.CLunchyXMLConnector;
import lunchy.data.classes.CLunchyXMLMenuDAO;
import lunchy.data.interfaces.ILunchyDataConnector;
import lunchy.data.interfaces.ILunchyMenuDAO;
import lunchy.data.interfaces.ILunchyUser;
import lunchy.mvc.views.CLunchyMenuView;
import lunchy.mvc.views.CLunchyMenuViewExample;

import org.eclipse.swt.widgets.Display;

public class CLunchyApplication
{
	public ILunchyDataConnector dataConnection;
	public Display display;
	public ILunchyUser currentUser = null;
	
	public boolean DEBUG = true;

	private static CLunchyApplication INSTANCE;
	
	private CLunchyApplication()
	{
		dataConnection = new CLunchyDBConnector();
		display = new Display();
	}
	
	public static CLunchyApplication getInstance()
	{
		if (INSTANCE == null)
		{
			INSTANCE = new CLunchyApplication();

			CLunchyFactory.getMainViewInstance();
		}
		
		return INSTANCE;
	}
	
	public void debug(String logstr)
	{
		if(DEBUG)
			System.out.println(logstr);
	}
}
